'\" te
.\"  Copyright (c) 2004, Sun Microsystems, Inc.  All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH USBKBM 4M "May 13, 2017"
.SH NAME
usbkbm \- keyboard STREAMS module for Sun USB Keyboard
.SH SYNOPSIS
.LP
.nf
\fB\fR
.fi

.LP
.nf
open("/dev/kbd", O_RDWR)
.fi

.SH DESCRIPTION
.LP
The \fBusbkbm\fR \fBSTREAMS\fR module processes byte streams generated by a
keyboard attached to a \fBUSB\fR port.  \fBUSB\fR keyboard is a member of
Human Interface Device (HID) Class, and \fBusbkbm\fR only supports the keyboard
protocol defined in the specification.  Definitions for altering keyboard
translation and reading events from the keyboard are in \fB<sys/kbio.h>\fR and
\fB<sys/kbd.h>\fR\&.
.sp
.LP
The \fBusbkbm\fR \fBSTREAMS\fR module adheres to the interfaces exported by
\fBkb\fR(4M). Refer to the \fBDESCRIPTION\fR section of \fBkb\fR(4M) for a
discussion of the keyboard translation modes and the \fBIOCTL\fR section for
the supported \fBioctl\fR(2) requests.
.SS "IOCTLS"
.LP
\fBUSB\fR Keyboard \fBusbkbm\fR returns different values for the following
ioctls than \fBkb\fR(4M):
.sp
.ne 2
.na
\fB\fBKIOCTYPE\fR \fR
.ad
.RS 13n
This \fBioctl()\fR returns a new keyboard type defined for the \fBUSB\fR
keyboard. All types are listed below:
.RE

.sp
.in +2
.nf
KB_SUN3   Sun Type 3 keyboard
KB_SUN4   Sun Type 4 keyboard
KB_ASCII  ASCII terminal masquerading as keyboard
KB_PC     Type 101 PC keyboard
KB_USB    USB keyboard
.fi
.in -2

.sp
.LP
The \fBUSB\fR keyboard type is \fBKB_USB\fR; \fBusbkbm\fR will return
\fBKB_USB\fR in response to the \fBKIOCTYPE\fR ioctl.
.sp
.ne 2
.na
\fB\fBKIOCLAYOUT\fR \fR
.ad
.RS 15n
The argument is a pointer to an \fBint\fR. The layout code specified by the
\fBbCountryCode\fR value returned in the \fBHID\fR descriptor is returned in
the int pointed to by the argument. The \fBcountrycodes\fR are defined in 6.2.1
of the \fBHID\fR 1.0 specifications.
.RE

.sp
.ne 2
.na
\fB\fBKIOCCMD\fR \fR
.ad
.RS 15n
.sp
.ne 2
.na
\fB\fBKBD_CMD_CLICK/KBD_CMD_NOCLICK\fR \fR
.ad
.sp .6
.RS 4n
The \fBkb\fR(4M) indicates that inappropriate commands for particular keyboards
are ignored. Because clicking is not supported on the \fBUSB\fR keyboard,
\fBusbkbm\fR ignores this command
.RE

.sp
.ne 2
.na
\fB\fBKBD_CMD_SETLED\fR \fR
.ad
.sp .6
.RS 4n
Set keyboard LEDs. Same as \fBkb\fR(4M).
.RE

.sp
.ne 2
.na
\fB\fBKBD_CMD_GETLAYOUT\fR \fR
.ad
.sp .6
.RS 4n
The country codes defined in 6.2.1 of the \fBHID\fR 1.0 specification are
returned.
.RE

.sp
.ne 2
.na
\fB\fBKBD_CMD_BELL/KBD_CMD_NOBELL\fR \fR
.ad
.sp .6
.RS 4n
This command is supported although the \fBUSB\fR keyboard does not have a
buzzer.  The request for the bell is rerouted.
.RE

.sp
.ne 2
.na
\fB\fBKBD_CMD_RESET\fR \fR
.ad
.sp .6
.RS 4n
There is no notion of resetting the keyboard as there is for the type4
keyboard. \fBusbkbm\fR ignores this command and does not return an error.
.RE

.RE

.SH FILES
.ne 2
.na
\fB/kernel/strmod/usbkbm\fR
.ad
.sp .6
.RS 4n
32-bit ELF kernel STREAMS module (x86 platform only)
.RE

.sp
.ne 2
.na
\fB/kernel/strmod/sparcv9/usbkbm\fR
.ad
.sp .6
.RS 4n
SPARC 64-bit ELF kernel STREAMS module
.RE

.SH ATTRIBUTES
.LP
See \fBattributes\fR(7) for a description of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Architecture	PCI-based  systems
.TE

.SH SEE ALSO
.LP
.BR dumpkeys (1),
.BR kbd (1),
.BR loadkeys (1),
.BR ioctl (2),
.BR hid (4D),
.BR usba (4D),
.BR virtualkm (4D),
.BR kb (4M),
.BR keytables (5),
.BR attributes (7)
.sp
.LP
\fISTREAMS Programming Guide\fR
.sp
.LP
\fISystem Administration Guide: Basic Administration\fR
.SH DIAGN0STICS
.LP
None
